package top.yokey.shopnc.activity.home;

import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.Toolbar;

import top.yokey.shopnc.R;
import top.yokey.shopnc.base.BaseApplication;
import top.yokey.shopnc.base.BaseConstant;
import top.yokey.base.base.BaseToast;
import top.yokey.shopnc.base.SwipeActivity;
import top.yokey.base.bean.ArticleBean;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;

/**
 * @author MapStory
 * @ qq 1002285057
 * @ Project https://gitee.com/MapStory/ShopNc-Android
 */

@ContentView(R.layout.activity_home_notice_show)
public class NoticeShowActivity extends SwipeActivity {

    @ViewInject(R.id.mainToolbar)
    private Toolbar mainToolbar;
    @ViewInject(R.id.contentTextView)
    private AppCompatTextView contentTextView;

    @Override
    public void initData() {

        ArticleBean articleBean = (ArticleBean) getIntent().getSerializableExtra(BaseConstant.DATA_BEAN);

        if (articleBean == null) {
            BaseToast.get().showDataError();
            BaseApplication.get().finish(getActivity());
        }

        assert articleBean != null;
        contentTextView.setText(articleBean.getArticleContent());
        setToolbar(mainToolbar, articleBean.getArticleTitle());

    }

    @Override
    public void initEven() {

    }

}
